<?php

use yii\helpers\Html;
use yii\widgets\Pjax;
use backend\components\widget\adminLTE\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $searchModel mdm\admin\models\searchs\Menu */

$this->title = Yii::t('rbac-admin', 'Menus');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header with-border">
                <h3 class="box-title"><?= Html::encode($this->title) ?></h3>
            </div>
            <div class="box-tools form-inline">
                <?php echo $this->render('_search', ['model' => $searchModel]); ?>
                <div class="box-body">
                    <?php Pjax::begin(); ?>
                    <?=GridView::widget([
                        'dataProvider' => $dataProvider,
                        'columns' => [
                            ['class' => 'yii\grid\SerialColumn'],
                            'name',
                            [
                                'attribute' => 'menuParent.name',
                                'filter' => Html::activeTextInput($searchModel, 'parent_name', [
                                    'class' => 'form-control', 'id' => null
                                ]),
                                'label' => Yii::t('rbac-admin', 'Parent'),
                            ],
                            'route',
                            'order',
                            [
                                'class' => 'backend\components\widget\adminLTE\ActionColumn',
                                'template' => '{update} {delete}',
                            ],
                        ],
                    ]);
                    ?>
                    <?php Pjax::end(); ?>
                </div>
            </div>
        </div>
    </div>
</div>
